<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo isset($admin_title)?$admin_title:"";?>-<?php echo isset($site_name)?$site_name:"";?></title>
<meta name="author" content="designer:webzhu, date:2012-03-23" />
<link type="image/x-icon" href="<?php echo urldecode(Url::urlFormat("@favicon.ico"));?>" rel="icon">
<link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("@static/css/base.css"));?>" />
<link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("@static/css/admin.css"));?>" />
<link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("@static/css/font_icon.css"));?>" />
<?php echo JS::import('jquery');?>
<script type="text/javascript" src="<?php echo urldecode(Url::urlFormat("@static/js/common.js"));?>"></script>
<!--[if lte IE 7]><script src="<?php echo urldecode(Url::urlFormat("@static/css/fonts/lte-ie7.js"));?>"></script><![endif]-->
</head>
<body >
<div id="header">
	<div class="nav_sub">
			    	您好[<?php echo isset($manager['name'])?$manager['name']:"";?>]&nbsp; | <a href="<?php echo urldecode(Url::urlFormat("/simple/login"));?>" target="_blank">返回前台</a> | <a href="<?php echo urldecode(Url::urlFormat("/admin/logout"));?>">退出</a>&nbsp; | &nbsp; <a id="btn_clear" href="javascript:;">清理缓存</a>
	</div>
    <div id="Logo"><a href=""><img src="<?php echo urldecode(Url::urlFormat("@static/images/logo_min.png"));?>"></a></div>
	<ul id="main_nav" class="clearfix">
	<?php foreach($mainMenu as $key => $item){?>
		<li <?php if($key==$menu_index['menu']){?>class="active"<?php }?>><a href="<?php echo urldecode(Url::urlFormat("$item[link]"));?>"  ><?php echo isset($item['name'])?$item['name']:"";?></a></li>
	<?php }?>
	</ul>
</div>
<div id="mainContent">
	<div id="sidebar" >
		<ul class="menu" style="margin-top:15px;">
		<?php foreach($subMenu as $key => $item){?>
			<li class="submenu">
			<ul><li class="sub-index"><b><a href="javascript:;"><?php echo isset($item['name'])?$item['name']:"";?></a></b></li>
			<?php foreach($menu->getNodes($item['link']) as $key => $item){?>
			<?php if(substr($item['link'],-5)!='_edit' && !$item['hidden'] ){?>
				<li><a href='<?php echo urldecode(Url::urlFormat("$item[link]"));?>' <?php if($item['link']==$nav_link){?>class="current"<?php }?> ><?php echo isset($item['name'])?$item['name']:"";?></a></li>
				<?php }?>
			<?php }?>
			</ul>
			</li>
		<?php }?>
		</ul>
	</div>
	<div id="content" >

		<?php if(!isset($msg)){?><?php $msg=Req::post('msg');?><?php }?>
		<?php if(!isset($validator)){?><?php $validator=Req::post('validator');?><?php }?>
		<?php if(isset($msg[0])){?>
		<div id="message-bar" class="message_<?php echo isset($msg[0])?$msg[0]:"";?>"><?php echo isset($msg[1])?$msg[1]:"";?></div>
		<?php }elseif(isset($validator)){?>
		<div class="message_warning"><?php echo isset($validator['msg'])?$validator['msg']:"";?></div>
		<?php }?>
		<?php echo JS::import('dialog?skin=brief');?>
<?php echo JS::import('dialogtools');?>
<?php echo JS::import('form');?>
<form name="zform" action="" method="post">
    <div class="tools_bar clearfix">

        <a class="icon-delicious" href="<?php echo urldecode(Url::urlFormat("/customer/active_list"));?>"> 全部用户</a>
        <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style=""> 筛选条件</a><input
                id="condition_input" type="hidden" name="condition" value="<?php echo isset($condition)?$condition:"";?>"></span>
    </div>
    <table class="default">
        <tr>
            <th>复投用户</th>
            <th>复投方式</th>
            <th>复投总金额</th>
            <th>扣除现金分</th>
            <th>扣除注册分</th>
            <th>复投时间</th>

        </tr>
        <?php $item=null; $obj = new Query("active_ft_list as a, user as u");$obj->fields = "a.*,u.name as name";$obj->where = "a.user_id = u.id and a.post = 2 and $where";$obj->page = "1";$obj->pagesize = "13";$obj->order = "a.user_id
        desc";$items = $obj->find(); foreach($items as $key => $item){?>
        <tr>
            <td>
                <?php echo Common::getUid($item['user_id'])['name'];?>
            </td>

            <td>
                <?php if( intval($item['method']) ==1 ){?>
                100%现金分
                <?php }?>
                <?php if( intval($item['method']) ==2 ){?>
                50%现金分 + 50%注册分
                <?php }?>
            </td>

            <td>
                <?php if($item['zje']>0){?>
                <b style="color:red">
                    <?php echo isset($item['zje'])?$item['zje']:"";?>
                </b>
                <?php }else{?>
                <?php echo isset($item['zje'])?$item['zje']:"";?>
                <?php }?>
            </td>
            <td>
                <?php if($item['xjf']>0){?>
                <b style="color:red">
                    <?php echo isset($item['xjf'])?$item['xjf']:"";?>
                </b>
                <?php }else{?>
                <?php echo isset($item['xjf'])?$item['xjf']:"";?>
                <?php }?>
            </td>
            <td>
                <?php if($item['zcf']>0){?>
                <b style="color:red">
                    <?php echo isset($item['zcf'])?$item['zcf']:"";?>
                </b>
                <?php }else{?>
                <?php echo isset($item['zcf'])?$item['zcf']:"";?>
                <?php }?>
            </td>

            <td><?php echo isset($item['time'])?$item['time']:"";?></td>

        </tr>
        <?php }?>
    </table>
</form>
<div class="page_nav">
    <?php echo $obj->pageBar();?>
</div>




<script type="text/javascript">
    function view(id){
        art.dialog.open("<?php echo urldecode(Url::urlFormat("/customer/dp_view/id/"));?>"+id,{id:'edit_dialog',title:'店铺信息',resize:false,width:500,height:300});
    }

    function close(){
        art.dialog({id:'edit_dialog'}).close();
        art.dialog.tips("<p class='success'>设置成功！</p>");
        window.location.reload();
    }

    //将输入的数字金额转换成对应的中文大写金额
    //idNumber输入的数字金额，idCHN输出的中文大写金额
    function TransformNumberIntoCHN(number) {
        if (!/^(0|[1-9]\d*)(\.\d{1,2})?$/.test(number)) {

            return false;
        }
        var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
        number += "00";
        var point = number.indexOf('.');
        if (point >= 0) {
            number = number.substring(0, point) + number.substr(point + 1, 2);
        }
        unit = unit.substr(unit.length - number.length);
        for (var i = 0; i < number.length; i++) {
            str += '零壹贰叁肆伍陆柒捌玖'.charAt(number.charAt(i)) + unit.charAt(i);
        }
        //document.getElementById(idCHN).value = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
        return str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
    }

    $(function () {
        $("#amount").blur(function () {
            var amount = $("#amount").val();
            if (isNaN(amount) || amount == '') {
                $("#lb_msg").text('');
                return;
            }
            var dxje = TransformNumberIntoCHN(amount);
            $("#lb_msg").text(dxje);
        });
    });


    function balance_op(user_id, type) {
        $("#user_id").val(user_id);
        $("#type").val(type);
        var title = "充值";
        if (type == 4) title = "扣款";
        $("#balance-title").text(title);
        $("#balance-btn").text(title);
        $("#amount").val('');
        art.dialog({
            id: 'balance_op',
            lock: true,
            opacity: 0.1,
            title: title,
            width: 600,
            height: 200,
            padding: "15px",
            content: document.getElementById("balance_box")
        });
    }
    function create_voucher(e) {
        if (e == null) {
            $("#balance-btn").attr("disabled", true);
            var fields = $("#export_form").serializeArray();
            $.get("<?php echo urldecode(Url::urlFormat("/customer/balance_op"));?>", fields, function (data) {
                if (data['status'] == 'success') {
                    art.dialog({id: 'balance_op'}).close();
                    art.dialog.tips("<p class='" + data['status'] + "'>" + data['msg'] + "</p>", 2);
                    setTimeout("tools_reload()", 2000);
                } else {
                    art.dialog.tips("<p class='" + data['status'] + "'>" + data['msg'] + "</p>");
                }
                $("#balance-btn").attr("disabled", false);
            }, 'json');
        }
        return false;
    }
</script>

<script type="text/javascript">
    var form = new Form();
    $("#condition").on("click", function () {
        //$("body").Condition({input:"#condition_input",okVal:'高级搜索',callback:function(data){tools_submit({action:'<?php echo urldecode(Url::urlFormat("/customer/customer_list"));?>',method:'get'});},data:{'name':{name:'账号'},real_name:{name:'姓名'},status:{name:'是否锁定',values:{1:'正常',2:'锁定'}},nojj:{name:'是否冻结',values:{0:'正常',1:'冻结'}},u_lx:{name:'身份',values:{0:'普通',1:'创客',2:'商家'}},mobile:{name:'手机号码'},reg_time:{name:'注册时间'}
        $("body").Condition({
            input: "#condition_input", okVal: '高级搜索', callback: function (data) {
                tools_submit({action: '<?php echo urldecode(Url::urlFormat("/customer/active_list"));?>', method: 'get'});
            }, data: {
                'name': {name: '账号'},
//                real_name: {name: '姓名'},
//                status: {name: '是否锁定', values: {1: '正常', 2: '锁定'}},
//                nojj: {name: '是否冻结', values: {0: '正常', 1: '冻结'}},
////                u_lx: {name: '身份', values: {0: '普通', 1: '服务中心', 2: '分公司'}},
//                zcf: {name: '注册分'},
//                jjf: {name: '奖金分'},
//                xjf: {name: '现金分'},
//                gwjf: {name: '购物积分'},
//                cxjf: {name: '重消积分'},
//                zc: {name: '资产'},
//                last_fhjf: {name: '剩余分红积分'},
                time: {name: '注册时间'},
//                group_id: {name:'投资级别', values: {1: '一级代理', 2: '二级代理', 3: '县代理',4:'市代理'}}
            }
        });
    });
</script>

	</div>
</div>
<script type="text/javascript">
	$(function () {
		if('<?php echo Req::args("con");?>'=='admin'){
			$(".submenu .current").parent().parent().parent().addClass('current');
		}else{
			$(".submenu").addClass('current');
		}
		$(".submenu .sub-index").on("click",function(){
			$(this).parent().parent().toggleClass('current');
		})
	})

</script>
</body>
</html>
<script>
	$("#btn_clear").on("click",function(){
		$.post("<?php echo urldecode(Url::urlFormat("/admin/clear_act"));?>",function(data){
			art.dialog.tips("<p class='"+data['status']+"'>"+data['msg']+"</p>");
		},'json');
	});
</script>
<!--Powered by TinyRise-->